<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>修改样式属性</title>
		<style type="text/css">
			div {
				width: 400px;
				height: 400px;
				background-color: pink;
			}
			.change {
				width: 500px;
				color: #0000FF;
				background-color: #00FF00;
				font-size: 24px;
			}
		</style>
	</head>
	<body>
		<div></div>
		<script type="text/javascript">
			var box = document.querySelector('div');
			box.onclick = function(){
				// this.style.backgroundColor = 'blue';
				// this.className  = 'change'; 会覆盖原来类名
				// 保留原来类名
				this.className  = 'first change';
			}
		</script>
	</body>
</html>
